package com.wugh.fast.demo.model;

import com.wugh.fast.module.api.annotation.IsDeleted;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.*;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 表名: sys_user
 * 系统用户表
 * @date 2019-11-20 16:33:33
 * @author 工具生成代码
 */
@Data
@Accessors(chain = true)
@ApiModel("系统用户表")
@Table(name = "sys_user")
public class UserDO {
    //region 数据库字段常量
    public static final String ID = "id";

    public static final String DB_ID = "id";

    public static final String IS_DELETED = "isDeleted";

    public static final String DB_IS_DELETED = "is_deleted";

    public static final String GMT_CREATE = "gmtCreate";

    public static final String DB_GMT_CREATE = "gmt_create";

    public static final String GMT_MODIFIED = "gmtModified";

    public static final String DB_GMT_MODIFIED = "gmt_modified";

    public static final String USERNAME = "username";

    public static final String DB_USERNAME = "username";

    public static final String PASSWORD = "password";

    public static final String DB_PASSWORD = "password";

    public static final String NICKNAME = "nickname";

    public static final String DB_NICKNAME = "nickname";

    public static final String PHONE_NUMBER = "phoneNumber";

    public static final String DB_PHONE_NUMBER = "phone_number";

    public static final String EMAIL = "email";

    public static final String DB_EMAIL = "email";

    public static final String USER_STATUS = "userStatus";

    public static final String DB_USER_STATUS = "user_status";

    public static final String PHONE_NUMBER_STATUS = "phoneNumberStatus";

    public static final String DB_PHONE_NUMBER_STATUS = "phone_number_status";

    public static final String EMAIL_STATUS = "emailStatus";

    public static final String DB_EMAIL_STATUS = "email_status";

    public static final String SEX = "sex";

    public static final String DB_SEX = "sex";
	//endregion;

    /**
     * 用户主键
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "JDBC")
    @ApiModelProperty("用户主键")
    private String id;

    /**
     * 是否删除,逻辑删除标识 0-未删除 1-已删除
     */
    @Column(name = "is_deleted")
    @ApiModelProperty("是否删除,逻辑删除标识 0-未删除 1-已删除")
    @IsDeleted
    private Short isDeleted;

    /**
     * 创建时间
     */
    @Column(name = "gmt_create")
    @ApiModelProperty("创建时间")
    private Date gmtCreate;

    /**
     * 最后修改时间,如果没有修改过,则和创建时间一致
     */
    @Column(name = "gmt_modified")
    @ApiModelProperty("最后修改时间,如果没有修改过,则和创建时间一致")
    private Date gmtModified;

    /**
     * 登录账号
     */
    @Column(name = "username")
    @ApiModelProperty("登录账号")
    private String username;

    /**
     * 密码,使用sha256+salt进行加密
     */
    @Column(name = "password")
    @ApiModelProperty("密码,使用sha256+salt进行加密")
    private String password;

    /**
     * 昵称
     */
    @Column(name = "nickname")
    @ApiModelProperty("昵称")
    private String nickname;

    /**
     * 手机号码
     */
    @Column(name = "phone_number")
    @ApiModelProperty("手机号码")
    private String phoneNumber;

    /**
     * 邮箱地址
     */
    @Column(name = "email")
    @ApiModelProperty("邮箱地址")
    private String email;

    /**
     * 状态 1-使用中 2-未绑定 3-停用
     */
    @Column(name = "user_status")
    @ApiModelProperty("状态 1-使用中 2-未绑定 3-停用")
    private Short userStatus;

    /**
     * 手机认证状态 1-不需要认证 2-已认证 3-未认证
     */
    @Column(name = "phone_number_status")
    @ApiModelProperty("手机认证状态 1-不需要认证 2-已认证 3-未认证")
    private Short phoneNumberStatus;

    /**
     * 邮箱认证状态 1-不需要认证 2-已认证 3-未认证
     */
    @Column(name = "email_status")
    @ApiModelProperty("邮箱认证状态 1-不需要认证 2-已认证 3-未认证")
    private Short emailStatus;

    /**
     * 性别:0-女,1-男
     */
    @Column(name = "sex")
    @ApiModelProperty("性别:0-女,1-男")
    private Short sex;

    /**
     * 带默认值的实例
    */
    public static UserDO defaultInstance() {
        UserDO instance = new UserDO();
        instance.isDeleted = 0;
        instance.username = "";
        instance.password = "";
        instance.nickname = "";
        instance.phoneNumber = "";
        instance.email = "";
        instance.userStatus = 1;
        instance.phoneNumberStatus = 1;
        instance.emailStatus = 1;
        instance.sex = 0;
        return instance;
    }
}